package com.ss.android.article.base.feature.user.account.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

import com.ss.android.article.browser.R;
import com.ss.android.newmedia.activity.FragmentActivity;

public class AccountEditActivity extends FragmentActivity {
    private a a;

    public AccountEditActivity() {

    }

    public int getLayout() {
        return R.layout.fragment_activity;
    }

    public void init() {
        super.init();
        if(this.mTitleBar != null) {
            this.mTitleBar.setVisibility(View.GONE);
        }

        this.a = new a();
        this.a.setArguments(new Bundle());
        FragmentTransaction v0 = this.getSupportFragmentManager().beginTransaction();
        v0.replace(com.ss.android.article.browser.R.id.fragment_container, this.a, "account_edit_fragment");
        v0.commit();
    }

    public void onBackPressed() {
        int v0_1;
        if(this.a != null) {
            a v0 = this.a;
            if(v0.b == null || !v0.b.isEnabled() || v0.b.getVisibility() != View.VISIBLE) {
                if(v0.getActivity() != null) {
                    Intent v1 = new Intent();
                    v1.putExtra("account_info", v0.f);
                    v0.getActivity().setResult(-1, v1);
                }

                v0_1 = 0;
            }
            else {
                a.a(v0.getActivity(), new g(v0), new h(v0));
                v0_1 = 1;
            }

            if(v0_1 != 0) {
                return;
            }

            super.onBackPressed();
        }
        else {
            super.onBackPressed();
        }
    }

    public boolean useSwipeRight() {
        return true;
    }
}

